package com.sun.config;

import com.ctrip.framework.apollo.ConfigFile;
import com.ctrip.framework.apollo.ConfigService;
import com.ctrip.framework.apollo.core.enums.ConfigFileFormat;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * API方式读取JSON
 */
@Configuration
public class JsonConfig {

    @Bean
    public void configJson() {
        ConfigFile configFile = ConfigService.getConfigFile("test-json", ConfigFileFormat.JSON);
        String content = configFile.getContent();
        System.out.println("JsonConfig = " + content);
    }

}
